package com.yuqing.myblogServe.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.lang.Nullable;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author yuqing
 * @since 2023-12-01
 */

@Data
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 文章id
     */

    private String articleId;

    /**
     * 文章作者
     */
    private String author;


    /**
     * 文章名
     */
    @NotEmpty(message = "文章名不能为空")
    private String articleTitle;

    /**
     * 文章内容
     */
    @NotEmpty(message = "文章内容不能为空")
    private String articleContent;

    /**
     * 文章标签
     */
    @NotEmpty(message = "文章标签不能为空")
    private String articleTags;
    /**
     * 文章类型
     */
    @NotEmpty(message = "文章类型不能为空")
    private String articleType;

    /**
     * 发布时间
     */
    private LocalDateTime publishDate;
    /**
     * 更新时间
     */
    private LocalDateTime updateDate;
    /**
     * 文章链接
     */
    @Nullable
    private String articleUrl="";
    /**
     * 文章摘要
     */
    @Nullable
    private String articleIntro ="";
    /**
     * 点赞数
     */
    private Integer likes;

    /**
     * 评论数
     */
    private Integer commentCount;



    private int isLike = 0;



    @Override
    public String toString() {
        return "Article{" +
        "id=" + id +
        ", articleId=" + articleId +
        ", author=" + author +
        ", articleTitle=" + articleTitle +
        ", articleContent=" + articleContent +
        ", articleTags=" + articleTags +
        ", articleType=" + articleType +
        ", publishDate=" + publishDate +
        ", updateDate=" + updateDate +
        ", articleUrl=" + articleUrl +
        ", articleTabloid=" + articleIntro +
        ", likes=" + likes +
        "}";
    }
}
